<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="static/css/reset.css">
    <link rel="stylesheet" href="css/common.css" />
    <link rel="stylesheet" href="css/resetpwd.css" />
    <title>重置密码</title>
</head>

<body>
    <div class="resetpwd w12">
        <div class="resetpwd-main">
            <div class="main">
                <div class="welcome">重置密码</div>
                <div class="phone">
                    <input type="text" id="phone" placeholder="请输入手机号码">
                    <span onclick="yzm()" id="yzm">获取验证码</span>
                </div>
                <div class="psd">
                    <input type="text" placeholder="请输入验证码">
                </div>
                <div class="psd">
                    <input type="password" placeholder="请输入新密码">
                </div>
                <div class="psd">
                    <input type="password" placeholder="请确认信密码">
                </div>
                <div class="login-button">
                    <button>确认</button>
                </div>
                <span class="go-home">返回首页</span>
            </div>
        </div>
    </div>
</body>
<script src='static/js/jquery.js'></script>
<script>
function checkMobile(phone) {
    if (!(/^1[3|4|5|7|8][0-9]\d{4,8}$/.test(phone))) {
        return 0;
    } else {
        return 1;
    }
}

function yzm() {
    if (checkMobile($("#phone").val()) == 1) {
        var time = 60;
        var timer = setInterval(function() {
            time--;
            if (time == 0) {
                clearInterval(timer)
                $("#yzm").text('获取验证码');
            } else {
                $("#yzm").text(time + 's');
            }
        }, 1000)
    }else{
        alert('请输入正确手机号码')
    }

}
</script>
<script src="js/common.js" type="text/javascript"></script>
</html>